import random


def generate_double_color_ball():
    """生成一注双色球号码"""
    red_balls = random.sample(range(1, 34), 6)
    blue_ball = random.randint(1, 16)
    return sorted(red_balls), blue_ball


# 生成2000万注并写入文件
# num_notes = 90000000  # 指定要生成的注数
num_notes = 5
#redWin, blueWin = [11, 16, 17, 21, 22, 26], 14
#print(redWin, blueWin)
num = 0
# with open('./data/double_color_ball_notes.txt', 'w') as f:
for i in range(num_notes):
    red, blue = generate_double_color_ball()
    # 格式化输出，例如: 01,02,03,04,05,06|07
    red_str = ','.join([f"{num:02d}" for num in red])
    line = f"{red_str}|{blue:02d}\n"
    # if (red, blue) == (redWin, blueWin):
    # line = f"{red_str}|{blue:02d}---------{num}------win\n"
    # num += 1
    print(line)

# print(f"生成完成！共生成 {num_notes} 注号码，已保存到 'double_color_ball_notes.txt'。")
